package com.example.constant;

/**
 * 封禁类型枚举
 */
public enum BanTypeEnum {
  /**
   * 1-封禁资金操作
   */
  FUND_OPERATION(1, "封禁资金操作","money"),
  /**
   * 2-敏感操作
   */
  SENSITIVE_OPERATION(2, "敏感操作","sensitive_operations"),
  /**
   * 3-全部封禁
   */
  ALL_OPERATION(3, "全部封禁","all");

  private final Integer code;
  private final String desc;
  private final String type;

  BanTypeEnum(Integer code, String desc, String type) {
    this.code = code;
    this.desc = desc;
    this.type = type;
  }

  public Integer getCode() {
    return code;
  }

  public String getDesc() {
    return desc;
  }
  public String getType() {
    return type;
  }

  public static BanTypeEnum getByCode(Integer code) {
    for (BanTypeEnum value : values()) {
      if (value.getCode().equals(code)) {
        return value;
      }
    }
    return null;
  }
}